
<div class="titles">
  <%= link_to '资产清单(Top50)','', :class => 'title h' %>
</div>
<div>
  <table border='0' cellpadding='1' cellspacing='1' id='money_feeds_body'>
    <tr>
      <th>行为</th>
      <th>时间</th>
      <th>数量</th>
      <th>余额</th>
      <th>备注</th>
    </tr>
    <% current_user.money_feeds.each do |feed| %>
    <% if feed.is_a?(Feed::MoneyDailyDraw) %>
    <tr class='<%= cycle '','l' %>'>                
      <td>每日领取</td>
      <td><%= time_ago_in_words feed.created_at, false %>前</td>
      <td class='add'>+<%= feed.added_money %></td>
      <td class='money'><%= feed.money %></td>
      <td></td>
      <!--td class='c'>
        <%= link_to '领取', '' , :class => 'get corner' %>
      </td-->
    </tr>
    <% elsif feed.is_a?(Feed::MoneyToolMonthConsumed)  %>
    <tr class='<%= cycle '','l' %>'>                
      <td>月消费-<%= link_to feed.tool.name, tool_url(feed.tool), :title => feed.tool.title, :target => :_blank, :class => :tool  %></td>
      <td><%= time_ago_in_words feed.created_at, false %>前</td>
      <td class='sub'>-<%= feed.subed_money %></td>
      <td class='money'><%= feed.money %></td>
      <td><%= feed.created_at.month %>月份的用于<%= link_to feed.tool.name, tool_url(feed.tool), :title => feed.tool.title, :target => :_blank, :class => :tool  %>的麦粒</td>
      <!--td class='c'>
        <%= link_to '领取', '' , :class => 'get corner' %>
      </td-->
    </tr>
    <% elsif feed.is_a?(Feed::MoneyJoin) %>
    <tr class='<%= cycle '','l' %>'>                
      <td>新人大礼包</td>
      <td><%= time_ago_in_words feed.created_at, false %>前</td>
      <td class='add'>+<%= feed.added_money %></td>
      <td class='money'><%= feed.money %></td>
      <td></td>
      <!--td class='c'>
        <%= link_to '领取', '' , :class => 'get corner' %>
      </td-->
    </tr>
    <% elsif feed.is_a?(Feed::MoneyLogo) %>
    <tr class='<%= cycle '','l' %>'>                
      <td>上传个性化头像！</td>
      <td><%= time_ago_in_words feed.created_at, false %>前</td>
      <td class='add'>+<%= feed.added_money %></td>
      <td class='money'><%= feed.money %></td>
      <td></td>
      <!--td class='c'>
        <%= link_to '领取', '' , :class => 'get corner' %>
      </td-->
    </tr>
    <% elsif feed.is_a?(Feed::MoneyFetion) %>
    <tr class='<%= cycle '','l' %>'>                
      <td>绑定飞信机器人！</td>
      <td><%= time_ago_in_words feed.created_at, false %>前</td>
      <td class='add'>+<%= feed.added_money %></td>
      <td class='money'><%= feed.money %></td>
      <td></td>
      <!--td class='c'>
        <%= link_to '领取', '' , :class => 'get corner' %>
      </td-->
    </tr>
    <% elsif feed.is_a?(Feed::MoneyIntroduceToJoin) %>
    <tr class='<%= cycle '','l' %>'>                
      <td>成功推荐<%= link_to feed.introducedor.nick_name, users_url(feed.introducedor), :target => :_blank, :class => :user %>注册成为会员！</td>
      <td><%= time_ago_in_words feed.created_at, false %>前</td>
      <td class='add'>+<%= feed.added_money %></td>
      <td class='money'><%= feed.money %></td>
      <td>
      </td>
      <!--td class='c'>
        <%= link_to '领取', '' , :class => 'get corner' %>
      </td-->
    </tr>
    <% elsif feed.is_a?(Feed::MoneyIntroduceToBindFetion) %>
    <tr class='<%= cycle '','l' %>'>                
      <td>成功推荐<%= link_to feed.introducedor.nick_name, users_url(feed.introducedor), :target => :_blank, :class => :user %>绑定了飞信！</td>
      <td><%= time_ago_in_words feed.created_at, false %>前</td>
      <td class='add'>+<%= feed.added_money %></td>
      <td class='money'><%= feed.money %></td>
      <td>
      </td>
      <!--td class='c'>
        <%= link_to '领取', '' , :class => 'get corner' %>
      </td-->
    </tr>
    <% elsif feed.is_a?(Feed::MoneyGift) %>
    <tr class='<%= cycle '','l' %>'>                
      <td>领取<%= feed.info.title %></td>
      <td><%= time_ago_in_words feed.created_at, false %>前</td>
      <td class='add'>+<%= feed.added_money %></td>
      <td class='money'><%= feed.money %></td>
      <td>
        <%= sanitize_all feed.info.content %>
      </td>
      <!--td class='c'>
        <%= link_to '领取', '' , :class => 'get corner' %>
      </td-->
    </tr>
    <% elsif feed.is_a?(Feed::MoneyConsumedInTaobao) %>
    <tr class='<%= cycle '','l' %>'>                
      <td>淘宝店消费获赠</td>
      <td><%= time_ago_in_words feed.created_at, false %>前</td>
      <td class='add'>+<%= feed.added_money %></td>
      <td class='money'><%= feed.money %></td>
      <td>
        消费<%= feed.rmb %>元购买<%= feed.consume_type %>获赠<%= feed.added_money%>麦粒
      </td>
      <!--td class='c'>
        <%= link_to '领取', '' , :class => 'get corner' %>
      </td-->
    </tr>
    <% elsif feed.is_a?(Feed::MoneyConsumedInTaobaoCallBack) %>
    <tr class='<%= cycle '','l' %>'>                
      <td>取消淘宝店消费赠送</td>
      <td><%= time_ago_in_words feed.created_at, false %>前</td>
      <td class='sub'>-<%= feed.subed_money %></td>
      <td class='money'><%= feed.money %></td>
      <td>
        取消消费<%= feed.rmb %>元购买<%= feed.consume_type %>获赠的<%= feed.added_money%>麦粒
      </td>
      <!--td class='c'>
        <%= link_to '领取', '' , :class => 'get corner' %>
      </td-->
    </tr>
    <% elsif feed.is_a?(Feed::MoneySex) %>
    <tr class='<%= cycle '','l' %>'>                
      <td>设置基本资料-性别</td>
      <td><%= time_ago_in_words feed.created_at, false %>前</td>
      <td class='add'>+<%= feed.added_money %></td>
      <td class='money'><%= feed.money %></td>
      <td></td>
    <% end %>
    <% end %>
    <% if current_user.money_feeds.empty? %>
    <tr>
      <td colspan='5' class='c'>无记录</td>
    </tr>
    <% end %>
  </table>
</div>  